import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '@/views/common/login.vue'
import regist from '@/views/common/regist.vue'
import index from '@/views/common/index.vue'
import homePage from '@/views/common/homePage.vue'
import personInfo from '@/views/common/PersonInfo.vue'
import StuAuthentication from '@/views/common/StuAuthentication.vue'
import JobsHistory from '@/views/common/JobsHistory.vue'
import AccountSet from '@/views/common/AccountSet.vue'
import NoCompletedJobs from '@/views/common/NoCompletedJobs.vue'
Vue.use(VueRouter)

const routes = [
  //配置默认的路径，默认显示登录页
  {
    path: '/',
    redirect: '/login'
  },
  //登录界面
  {
    path: '/login',
    component: login
  },

  // 注册
  {
    path: '/regist',
    component: regist
  },
  // 主页
  {
    path: '/index',
    component: index
  },
  //学生个人中心
  {
    path: '/homePage',
    redirect: '/homePage/personInfo',
    component: homePage,
    children: [
      { path: 'personInfo', component: personInfo },
      { path: 'StuAuthentication', component: StuAuthentication },
      { path: 'JobsHistory', component: JobsHistory },
      { path: 'AccountSet', component: AccountSet },
      { path: 'NoCompletedJobs', component: NoCompletedJobs }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
